﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using WebTest.Core.Entities.OrderAggregate;

namespace WebTest.Core.Interfaces
{
    public interface IOrderService
    {
        Task AddAsync(Order order, CancellationToken cancellationToken = default);
        Task DeleteAsync(Guid id);
        Task DeleteAsync(Order order);
        Task DeleteRangeAsync(List<int> list);
        Task<Order> GetOrderByIdAsync(Guid id, CancellationToken cancellationToken = default);
        Task<Order> LastOrderAsync(CancellationToken cancellationToken = default);
        Task<IReadOnlyCollection<Order>> GetOrderListAsync(Expression<Func<Order, bool>> predicate, CancellationToken cancellationToken = default);
        Task<Order> UpdateOrderAsync(Order order, CancellationToken cancellationToken = default);
        Task DeleteOrderItemAsync(Guid id, OrderItem orderItem, CancellationToken cancellationToken = default);
        Task<IReadOnlyCollection<Order>> GetOrderListAsync(int pageSize = 20, int current = 1, CancellationToken cancellationToken = default);
    }
}
